MESSAGE_CODE = {
    success: 0,
    dataInvalid: 10002,
    unknow: 10000
};

CODE_MESSAGE = {
    10000: "CODE_MESSAGE_10000",
    10001: "CODE_MESSAGE_10001",
    10002: "CODE_MESSAGE_10002",
    11001: "CODE_MESSAGE_11001",
    11002: "CODE_MESSAGE_11002",
    11003: "CODE_MESSAGE_11003",
    11004: "CODE_MESSAGE_11004",
    11005: "CODE_MESSAGE_11005",
    11006: "CODE_MESSAGE_11006",
    11007: "CODE_MESSAGE_11007",
    11008: "CODE_MESSAGE_11008",
    11009: "CODE_MESSAGE_11009",
    11101: "CODE_MESSAGE_11101",
    11201: "CODE_MESSAGE_11201",
    11202: "CODE_MESSAGE_11202",
    11203: "CODE_MESSAGE_11203",
    11204: "CODE_MESSAGE_11204",
    11205: "CODE_MESSAGE_11205",
    11206: "CODE_MESSAGE_11206",
    11207: "CODE_MESSAGE_11207",
    11208: "CODE_MESSAGE_11208",
    11209: "CODE_MESSAGE_11209",
    11301: "CODE_MESSAGE_11301",
    11302: "CODE_MESSAGE_11302",
    11303: "CODE_MESSAGE_11303",
    11304: "CODE_MESSAGE_11304",
    11305: "CODE_MESSAGE_11305",
    11401: "CODE_MESSAGE_11401",
    11402: "CODE_MESSAGE_11402",
    11403: "CODE_MESSAGE_11403",
    11404: "CODE_MESSAGE_11404",
    11405: "CODE_MESSAGE_11405",
    11406: "CODE_MESSAGE_11406",
    11407: "CODE_MESSAGE_11407",
    11408: "CODE_MESSAGE_11408",
    11409: "CODE_MESSAGE_11409",
    11410: "CODE_MESSAGE_11410",
    11411: "CODE_MESSAGE_11411",
    11412: "CODE_MESSAGE_11412",
    11413: "CODE_MESSAGE_11413",
    11501: "CODE_MESSAGE_11501",
    11502: "CODE_MESSAGE_11502",
    11601: "CODE_MESSAGE_11601",
    11602: "CODE_MESSAGE_11602",
    11701: "CODE_MESSAGE_11701",
    11702: "CODE_MESSAGE_11702",
    11703: "CODE_MESSAGE_11703",
    11704: "CODE_MESSAGE_11704",
    11901: "CODE_MESSAGE_11901",
    12001: "CODE_MESSAGE_12001",
    12002: "CODE_MESSAGE_12002",
    12003: "CODE_MESSAGE_12003",
    12004: "CODE_MESSAGE_12004",
    12005: "CODE_MESSAGE_12005",
    12006: "CODE_MESSAGE_12006",
    12007: "CODE_MESSAGE_12007",
    12008: "CODE_MESSAGE_12008",
    12009: "CODE_MESSAGE_12009",
    12010: "CODE_MESSAGE_12010",
    12011: "CODE_MESSAGE_12011",
    12012: "CODE_MESSAGE_12012",
    12013: "CODE_MESSAGE_12013",
    12014: "CODE_MESSAGE_12014",
    12015: "CODE_MESSAGE_12015",
    12016: "CODE_MESSAGE_12016",
    12017: "CODE_MESSAGE_12017",
    12018: "CODE_MESSAGE_12018",
    12019: "CODE_MESSAGE_12019",
    12020: "CODE_MESSAGE_12020",
    12021: "CODE_MESSAGE_12021",
    12022: "CODE_MESSAGE_12022",
    12023: "CODE_MESSAGE_12023",
    12024: "CODE_MESSAGE_12024",
    12025: "CODE_MESSAGE_12025",
    12026: "CODE_MESSAGE_12026",
    12027: "CODE_MESSAGE_12027",
    12028: "CODE_MESSAGE_12028",
    12029: "CODE_MESSAGE_12029",
    12030: "CODE_MESSAGE_12030",
    12031: "CODE_MESSAGE_12031",
    12032: "CODE_MESSAGE_12032",
    12034: "CODE_MESSAGE_12034",
    12035: "CODE_MESSAGE_12035",
    13001: "CODE_MESSAGE_13001",
    14001: "CODE_MESSAGE_14001",
    14002: "CODE_MESSAGE_14002",
    14003: "CODE_MESSAGE_14003",
    14004: "CODE_MESSAGE_14004",
    14005: "CODE_MESSAGE_14005",
    14006: "CODE_MESSAGE_14006",
    14007: "CODE_MESSAGE_14007",
    14008: "CODE_MESSAGE_14008",
    14009: "CODE_MESSAGE_14009",
    14010: "CODE_MESSAGE_14010",
    15031: "CODE_MESSAGE_15031",
    15032: "CODE_MESSAGE_15032",
    15033: "CODE_MESSAGE_15033",
    15034: "CODE_MESSAGE_15034",
    15035: "CODE_MESSAGE_15035",
    15036: "CODE_MESSAGE_15036",
    15037: "CODE_MESSAGE_15037",
    15038: "CODE_MESSAGE_15038",
    15039: "CODE_MESSAGE_15039",
    15040: "CODE_MESSAGE_15040",
    16001: "CODE_MESSAGE_16001",
    16002: "CODE_MESSAGE_16002",
    16003: "CODE_MESSAGE_16003",
    17001: "CODE_MESSAGE_17001",
    17002: "CODE_MESSAGE_17002",
    17003: "CODE_MESSAGE_17003",
    17004: "CODE_MESSAGE_17004",
};

NODE_CONN_ERROR_CODE = [11701, 11702, 11703, 11704];
NODE_ENDPOINT_LABEL = "crane.reserved.node.endpoint";

SHOW_ERROR_MESSAGE = [10001];

BACKEND_URL = {
    auth: {
        login: 'account/v1/login',
        logout: 'account/v1/logout',
        aboutme: 'account/v1/aboutme',
        groups: 'account/v1/accounts/$account_id/groups'
    },
    node: {
        nodes: 'api/v1/nodes',
        nodeInfo: 'api/v1/nodes/$node_id/info',
        node: 'api/v1/nodes/$node_id',
        leader: 'api/v1/nodes/manager_info',
        volumes: 'api/v1/nodes/$node_id/volumes',
        volume: 'api/v1/nodes/$node_id/volumes/$volume_id',
        images: 'api/v1/nodes/$node_id/images',
        image: 'api/v1/nodes/$node_id/images/$image_id',
        imageHistory: 'api/v1/nodes/$node_id/images/$image_id/history',
        containers: 'api/v1/nodes/$node_id/containers',
        container: 'api/v1/nodes/$node_id/containers/$container_id',
        containerDiff: 'api/v1/nodes/$node_id/containers/$container_id/diff',
        containerLog: 'api/v1/nodes/$node_id/containers/$container_id/logs',
        containerStats: 'api/v1/nodes/$node_id/containers/$container_id/stats',
        containerTerminal: 'api/v1/nodes/$node_id/containers/$container_id/terminal',
        networks: 'api/v1/nodes/$node_id/networks',
        network: 'api/v1/nodes/$node_id/networks/$network_id'
    },
    stack: {
        stacks: 'api/v1/stacks',
        stack: 'api/v1/stacks/$stack_name',
        services: 'api/v1/stacks/$stack_name/services',
        service: 'api/v1/stacks/$stack_name/services/$service_id',
        serviceCdUrl: 'api/v1/stacks/$stack_name/services/$service_id/cd_url',
        serviceRollingUpdate: 'api/v1/stacks/$stack_name/services/$service_id/rolling_update',
        tasks: 'api/v1/stacks/$stack_name/services/$service_id/tasks',
        serviceLog: 'api/v1/stacks/$stack_name/services/$service_id/logs',
        serviceStats: 'api/v1/stacks/$stack_name/services/$service_id/stats'
    },
    network: {
        network: 'api/v1/networks/$network_id',
        container: 'api/v1/networks/$network_id/container',
        networks: 'api/v1/networks'
    },
    misc: {
        config: 'misc/v1/config'
    },
    registry: {
        publicRepositories: 'registry/v1/repositories/public',
        mineRepositories: 'registry/v1/repositories/mine',
        listTags: 'registry/v1/tag/list/$repository',
        image: 'registry/v1/manifests/$tag/$repository',
        publicity: 'registry/v1/$namespace/$image/publicity',
        catalogs: 'catalog/v1/catalogs',
        catalog: 'catalog/v1/catalogs/$catalog_id'
    },
    registryauth: {
        registryauths: 'registryauth/v1/registryauths',
        registryauth: 'registryauth/v1/registryauths/$regauth_name'
    },
    layout: {
        search: 'search/v1/luckysearch'
    },
    license: {
        license: 'license/v1/license'
    }
};
